Introduction
MATLAB Simulink provides a toolset for modelling and simulating the generation, transmission, distribution, and consumption of electrical power. In this class we shall:
- Explore the blocks of the Simscape Electrical Specialised Power System Library;
- Learn how to build a single phase transmission system model by bringing these blocks into the Simulink workspace;
- Learn about the Powergui block and how it is used to define our Simulation Solver;
- Interconnect blocks to create our circuit and run our simulation;
- Bring in and configure various measurement blocks to view the results of our simulation.
Our Single Phase Transmission System
The circuit illustrated in the figure below represents an equivalent power system feeding a 300 km transmission line. The line feeds a static load at its receiving end and is also provided with voltage compensation by means of a shunt reactor. A circuit breaker allows us to switch the circuit in or out of service, i.e., to energise or de-energise the line.
The parameters selected here are arbitrary but in any case representative of typical 400 kV transmission system.
Figure: Single Phase Transmission System
Creating the Model
- To open Simulink, at the MATLAB Command Window, enter: ‘simulink’
- Select to open a blank model and save the new model as: ‘Simple_SL_Transmission_System.slx’.
- Open the Library Browser and navigate the tree structure to:
- Simscape / Electrical / Specialised Power Systems
- Note: you can open a browser direct to this block library by entering the command ‘simpowersystems_ST’ into the MATLAB Command Window.
- This library contains many of the blocks that we shall be use to build our model.
Modelling the Generator
- Add an ‘AC Voltage Source’ block to the model by dragging and dropping the block into the workspace.
- Simscape / Electrical / Specialised Power Systems / Fundamental Blocks / Electrical Sources
- By clicking on the block name, rename it to: ‘Generator’.
- By double-clicking on the AC Voltage Source block within the model, set the parameters for the block as shown in our circuit diagram.
- Note: this block requires peak amplitude of voltage to be input, i.e., a 400 kV RMS voltage should be entered as ‘400e3*sqrt(2)’.
Modelling the Generator Impedance
- Add a ‘Parallel RLC Branch’ block to the model, rename to ‘Z_eq’ and set the parameters in accordance with our circuit diagram.
- Simscape / Electrical / Specialised Power Systems / Fundamental Blocks / Elements
- Add a second ‘Parallel RLC Branch’ block (or copy the one above), rename to ‘R_source’ and set the parameters in accordance with our circuit diagram.
- Change Branch Type from ‘RLC’ to ‘R’ if the block is only to model resistive elements. Note that the inductive and capacitive icons in the block disappear once this change has been applied.
- HINT: blocks can be copied quickly pressing (and holding) the CTRL key, click and drag upon the existing block and drag to a new location.
Modelling the Generator Connections
- Add a ‘Ground’ block to the model.
- Simscape / Electrical / Specialised Power Systems / Fundamental Blocks / Elements
- Resize and re-position the blocks to your preference.
- By dragging lines between the terminals of each block, make the connections between blocks in accordance with our circuit diagram.
- Note that these connections act as lines or cables in a power system but have zero impedance.
- To model line and cable impedance, specific blocks need to be brought into the model to represent those components.
Modelling the Transmission Line
- Add a ‘PI Section Line’ block to the model, rename to ‘Transmission Line’ and set the parameters in accordance with our circuit diagram.
- Simscape / Electrical / Specialised Power Systems / Fundamental Blocks / Elements
- A transmission line with uniformly distributed RLC parameters results in a time delay due to wave propagation along the line. We cannot model this continuously as the delay corresponds to an infinite number of states. However the PI Section Line allows us to simulate a good approximation of this using a finite number of cascading PI circuits (discrete elements) each representing a small section of the line.
- Each PI Section consists of a series RL branch with two shunt C branches. The model accuracy (and run time) depends on the number of PI sections stipulated for the model.
Modelling the Load and Shunt Reactor
- Add two ‘Series RLC Load’ blocks to the model, rename to ‘Load’ and ‘Shunt Reactor’ and set the parameters in accordance with our circuit diagram.
- Simscape / Electrical / Specialised Power Systems / Fundamental Blocks / Elements
- Note that the Series Load Block allows you to specify the active and reactive powers directly instead of the RLC parameters (see ‘Series RLC Branch’ block).
The quality factor allows us to calculate the absorbed power of the shunt reactor: (P = Q/k)
- Add the required ‘Ground’ blocks to the model and connect all of our elements in accordance with the circuit diagram.
- Note that at present we are omitting the circuit breaker. This shall be considered at a later stage.
The Powergui Block
The final requirement is to configure the solver. To do so, we add the ‘powergui’ block to the model.
- Simscape / Electrical / Specialised Power Systems / Fundamental Blocks
The powergui block is the environment block for Simscape Electrical Specialized Power Systems models. It is used to store the equivalent Simulink circuit that represents the state-space equations of Specialised Power System blocks.
The powergui block offers various tools for specific analyses (such as FFT Analysis) and preferences that can be modified to for advanced parameter design or model initialisation.
The powergui block allows us to choose one of these methods for solving our model:
- Continuous, utilising a variable step solver
- Discrete, utilising a fixed step solver
- Phasor, solving the phase space equations
We may return to some of these settings later but for now we can leave this block set to it’s default ‘Continuous’ type simulation and solve our model.
Running our Model
To run the model press the run simulation button illustrated below:
Shortcut key stroke: CTRL + T
If there are any errors in the model, the Diagnostic Viewer window will automatically display them.
Further information on troubleshooting using the Diagnostic Viewer can be found at:
Once our model has successfully solved we are able to start viewing the results of our simulation. This will require some additional measurement blocks to be added into the model.
Measuring Voltage
- Add a ‘Voltage Measurement’ block to the model, rename to ‘U1’ and connect the positive terminal to the output of our generator equivalent circuit. Connect the negative terminal to a ‘Ground’ block.
- Simscape / Electrical / Specialised Power Systems / Fundamental Blocks / Measurements
- To visualise this voltage, a display system is required. Connect a ‘scope’ block to the output of the voltage measurement as illustrated.
- Simulink / Sinks
Run the simulation again. Double click on the scope block to view the results. The scope block will automatically adjust the axis scale to fit the results. Explore each of the various zooming tools in the toolbar so that you can visualise the AC voltage waveform.
- Simulink / Sinks
Comparing Transmission Line Voltages
- Add a second ‘Voltage Measurement’ block to the model, rename to ‘U2’ and connect the positive terminal to the end of our transmission line.
- Connect the output of this second measurement block to the same scope.
- Note that the scope should add an additional terminal automatically but if it does not the number of input ports can be configured by right clicking on the scope and selecting the number of inputs from within ‘signals and ports’.
Run the simulation again. Open the scope and adjust the axis scale so that you can view the voltage drop along the line. Explore the use of the cursor measurement tool in the toolbar so that you can quantify the change in peak AC voltage.
- Note that the scope should add an additional terminal automatically but if it does not the number of input ports can be configured by right clicking on the scope and selecting the number of inputs from within ‘signals and ports’.
Measuring Current
- Add a ‘Current Measurement’ block to the model, rename to ‘I2’ and connect it in series to the output of our transmission line as illustrated.
- Simscape / Electrical / Specialised Power Systems / Fundamental Blocks / Measurements
- To view the RMS current add an ‘RMS’ and ‘Scope’ block to the model and connect to the output of the current measurement block.
- …Specialised Power Systems / Control & Measurements / Measurements
Run the simulation again. Double click on the scope block to view the results.
- …Specialised Power Systems / Control & Measurements / Measurements
Exercise: Calculating Power Flow
With what we’ve learned in this module, students are now able to use MATLAB to calculate the power flow at the end of the transmission line.
- Using the ‘Power Measurement’ block (or otherwise) calculate and visualise the power flow at the end of the transmission line.
- Help documentation for the power measurement block can be accessed from within the block.
- Note that we are only concerned with calculating the power flow at the fundamental frequency.
- Compare the real and reactive power flows to those expected considering the loads attached to this node.
Completing this module students should feel comfortable with:
- Building a single phase electrical system model representing a transmission line;
- Configuring the solver for a variable step simulation;
- Using measurement blocks to interrogate various electrical system properties; and
- Using the scope blocks to view the results of our simulation.